﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ExtAspNet;

namespace HY.WEB.SA
{
    public partial class jobs_view : PageBase
    {
        public string us, whe = "", path = "";           
        protected void Page_Load(object sender, EventArgs e)
        {
            us = Session["ID"].ToString();
            if (!IsPostBack)
            {
                if (!String.IsNullOrEmpty(Request["sid"]))
                {
                     hidsid.Text = Request["sid"].Trim();                
                }
             
                fill2();
            }

        
        }

        

        void fill2()
        {
        
        BLL.CO.jobs S = new BLL.CO.jobs();
 
          DataTable d=  S.GetList("sid="+hidsid.Text).Tables[0];
          hidsid.Text = d.Rows[0]["sid"].ToString().Trim();
          hidbh.Text = d.Rows[0]["jbh"].ToString().Trim();

          ddlcompany.Text = d.Rows[0]["cname"].ToString().Trim();
          txtjob.Text = d.Rows[0]["title"].ToString().Trim();

          ddlgw.Text = get_cate(d.Rows[0]["cate"].ToString().Trim());
          ddlgwsub.Text = get_cate_sub(d.Rows[0]["cate_sub"].ToString().Trim());

          ddlSheng.Text =get_area( d.Rows[0]["area"].ToString().Trim());
          ddlShi.Text = get_area_sub(d.Rows[0]["area_sub"].ToString().Trim());

          ddlzone.Text = get_zone(d.Rows[0]["zone"].ToString().Trim());
          txtjobday.Text = d.Rows[0]["jobday"].ToString().Trim();
          txtage.Text = d.Rows[0]["age"].ToString().Trim();
          ddledu.Text = d.Rows[0]["edu"].ToString().Trim();

          date1.Text = d.Rows[0]["stdate"].ToString().Trim();
          date2.Text = d.Rows[0]["edate"].ToString().Trim();

          ddlsex.Text = d.Rows[0]["sex"].ToString().Trim();



          txtkey.Text = d.Rows[0]["keys"].ToString();

          txtmoney.Text = d.Rows[0]["moneys"].ToString().Trim();

          txtnum.Text = d.Rows[0]["pnum"].ToString();

          txtsales.Text = d.Rows[0]["sales"].ToString();

          txtpdtime.Text = d.Rows[0]["updtime"].ToString();

          txtmemo.Text = Server.HtmlDecode(d.Rows[0]["remarker"].ToString().Trim());
          }

        public string get_cate(string val)
        {
            return BLL.Bllbase.get_val("pub_cate", "svalue", "scode='" + val + "'");

        }
        public string get_cate_sub(string val)
        {
            return BLL.Bllbase.get_val("pub_cate_sub", "svalue", "scode='" + val + "'");

        }
        public string get_area(string val)
        {
            return BLL.Bllbase.get_val("pub_area", "svalue", "scode='" + val + "'");

        }
        public string get_area_sub(string val)
        {
            return BLL.Bllbase.get_val("pub_area_sub", "svalue", "scode='" + val + "'");

        }

        public string get_zone(string val)
        {
            return BLL.Bllbase.get_val("pub_zone", "svalue", "scode=" + val + "");
        }

    }
}